package codetop.microsoft.T153;

/**
 * @Author: 18362
 * @Create: 2022-08-28 15:38:55 星期日
 */
class Solution {
    public int findMin(int[] nums) {
        int left = 0, right = nums.length-1;
        while (left < right) {
            if (nums[left] < nums[right])
                break;
            int mid = left + (right - left) / 2;
            if (nums[mid] >= nums[left])
                left = mid + 1;
            else {
                left++;
                right = mid;
            }
        }
        return nums[left];
    }
}